package org.nimi317.web_gis.Enum;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * @author thunderobot
 */
@AllArgsConstructor
@Getter
public enum ModelStatus {

    Training(0, "训练中", ButtonStatus.WARNING),

    Error(1, "训练出错", ButtonStatus.DANGER),

    Waiting(2, "等待中", ButtonStatus.INFO),

    Finished(3, "已完成", ButtonStatus.SUCCESS),
    Full(4, "队列已满", ButtonStatus.PRIMARY);

    @EnumValue
    @JsonValue
    @JSONField
    private final int code;

    private final String value;

    private final ButtonStatus type;

    public Map<String, ?> getObject() {
        return Map.of("code", code, "value", value, "type", type.getType());
    }
}
